package com.husong.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class PointcutRuleUtil {
	public static double base=50D;
	public static List<Map<String,Object>> convertToRule(Long point){
		
		List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
		Map<String,Object> map1=new HashMap<String,Object>();
		map1.put("title", "碌碌无为");
		map1.put("point", "0-50");
		map1.put("red", "0");
		map1.put("withdraw", "0%");
		Map<String,Object> map2=new HashMap<String,Object>();
		map2.put("title", "入门弟子");
		map2.put("point", "50");
		map2.put("red", "3");
		map2.put("withdraw", "0.1%");
		Map<String,Object> map3=new HashMap<String,Object>();
		map3.put("title", "初入江湖");
		map3.put("point", "100");
		map3.put("red", "5");
		map3.put("withdraw", "0.2%");
		Map<String,Object> map4=new HashMap<String,Object>();
		map4.put("title", "小有名气");
		map4.put("point", "200");
		map4.put("red", "6");
		map4.put("withdraw", "0.4%");
		Map<String,Object> map5=new HashMap<String,Object>();
		map5.put("title", "名动一方");
		map5.put("point", "400");
		map5.put("red", "8");
		map5.put("withdraw", "0.8%");
		Map<String,Object> map6=new HashMap<String,Object>();
		map6.put("title", "江湖豪侠");
		map6.put("point", "800");
		map6.put("red", "9");
		map6.put("withdraw", "1%");
		Map<String,Object> map7=new HashMap<String,Object>();
		
		map7.put("title", "一派掌门");
		map7.put("point", "1600");
		map7.put("red", "10");
		map7.put("withdraw", "1.1%");
		Map<String,Object> map8=new HashMap<String,Object>();
		map8.put("title", "武林盟主");
		map8.put("point", "3200");
		map8.put("red", "11");
		map8.put("withdraw", "1.2%");
		Map<String,Object> map9=new HashMap<String,Object>();
		map9.put("title", "一代宗师");
		map9.put("point", "6400");
		map9.put("red", "12");
		map9.put("withdraw", "1.3%");
		Map<String,Object> map10=new HashMap<String,Object>();
		map10.put("title", "超凡入圣");
		map10.put("point", "12800");
		map10.put("red", "15");
		map10.put("withdraw", "1.6%");
		Map<String,Object> map11=new HashMap<String,Object>();
		map11.put("title", "天人合一");
		map11.put("point", "25600");
		map11.put("red", "20");
		map11.put("withdraw", "1.8%");
		Map<String,Object> map12=new HashMap<String,Object>();
		map12.put("title", "返璞归真");
		map12.put("point", "51200");
		map12.put("red", "25");
		map12.put("withdraw", "2.0%");
		Map<String,Object> map13=new HashMap<String,Object>();
		map13.put("title", "笑傲江湖");
		map13.put("point", "102400");
		map13.put("red", "50");
		map13.put("withdraw", "2.5%");
		Map<String,Object> map14=new HashMap<String,Object>();
		map14.put("title", "东方不败");
		map14.put("point", "204800");
		map14.put("red", "100");
		map14.put("withdraw", "3.5%");
		Map<String,Object> map15=new HashMap<String,Object>();
		map15.put("title", "独孤求败");
		map15.put("point", "409600");
		map15.put("red", "500");
		map15.put("withdraw", "4.5%");
		Map<String,Object> map16=new HashMap<String,Object>();
		map16.put("title", "天外飞仙");
		map16.put("point", "819200");
		map16.put("red", "500");
		map16.put("withdraw", "5.0%");
		
		list.add(map1);
		list.add(map2);
		list.add(map3);
		list.add(map4);
		list.add(map5);
		list.add(map6);
		list.add(map7);
		list.add(map8);
		list.add(map9);
		list.add(map10);
		list.add(map11);
		list.add(map12);
		list.add(map13);
		list.add(map14);
		list.add(map15);
		list.add(map16);
		
		
		List<Map<String,Object>> returnlist=new ArrayList<Map<String,Object>>();
		
		if(point<Math.pow(2, 0)*50){
			for(int i=0;i<1;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 0)*50&&point<Math.pow(2, 1)*50){
			for(int i=0;i<2;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 1)*50&&point<Math.pow(2, 2)*50){
			for(int i=0;i<3;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 2)*50&&point<Math.pow(2, 3)*50){
			for(int i=0;i<4;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 3)*50&&point<Math.pow(2, 4)*50){
			for(int i=0;i<5;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 4)*50&&point<Math.pow(2, 5)*50){
			for(int i=0;i<6;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 5)*50&&point<Math.pow(2, 6)*50){
			for(int i=0;i<7;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 6)*50&&point<Math.pow(2, 7)*50){
			for(int i=0;i<8;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 7)*50&&point<Math.pow(2, 8)*50){
			for(int i=0;i<9;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 8)*50&&point<Math.pow(2, 9)*50){
			for(int i=0;i<10;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 9)*50&&point<Math.pow(2, 10)*50){
			for(int i=0;i<11;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 10)*50&&point<Math.pow(2, 11)*50){
			for(int i=0;i<12;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 11)*50&&point<Math.pow(2, 12)*50){
			for(int i=0;i<13;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 12)*50&&point<Math.pow(2, 13)*50){
			for(int i=0;i<14;i++){
				returnlist.add(list.get(i));
			}
		}else if(point>=Math.pow(2, 13)*50&&point<Math.pow(2, 14)*50){
			for(int i=0;i<15;i++){
				returnlist.add(list.get(i));
			}
		}else{
			for(int i=0;i<16;i++){
				returnlist.add(list.get(i));
			}
		}
		
		return returnlist;
	}
	
	public static void main(String[] args) {
		for(int i=0;i<16;i++){
			System.out.println(Math.pow(2, i)*50);
		}
	}
	
}
